#include <iostream>
#include <string>
using namespace std;

class SimpleClass
{
    int a, b;
public:
    void fun1(){}
};

class Base
{
    int a, b;
public:
    //添加关键字virtual带来的影响是 编译器将为base生成一个虚函数表, 并为其虚函数指针预留空间,
    virtual void fun1(){}
};

int main()
{
    cout << "size of simple class " << sizeof(SimpleClass) << endl;
    cout << "size of base " << sizeof(Base) << endl;
    return 0;
}
